home *** CD-ROM | disk | FTP | other *** search
- * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
- * The C++ Answer Book */
- * Tony Hansen */
- * All rights reserved. */
- * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
- * The C++ Answer Book */
- * Tony Hansen */
- * All rights reserved. */
- / <tstbadalign.h>
- / this macro will test an assignment
- / to an address of each possible offset
- / for a given type
- define tstbadalignments(type,typestr) \
- { \
- type *ip; \
- type ivar; \
- int offset; \
- cout << "Type = " << typestr << "\n"; \
- for (offset = 0; \
- offset < sizeof(type); \
- offset++) \
- { \
- cout << "\toffset = " << offset; \
- ip = (type *)&foovar.a[offset]; \
- if (!setjmp(jmpenv)) \
- ivar = *ip; \
- cout << "\n"; \
- } \
- }
-